From: Jonas Dreßler Date: Mon, 24 Jul 2023 20:22:49 +0000 (+0200) Subject: appDisplay: Set popup menu side via parameter to AppIcon class X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~116^2^2~26 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=0c6f176c9ad48edfc3e25beb889ff3672d7d5028;p=gnome-shell.git appDisplay: Set popup menu side via parameter to AppIcon class Let's make the "side" argument to the popupMenu() function for app icons a param to the AppIcon class itself. The side is not that dynamic that it needs to be defined on calling of the function, instead it can be defined on creation of the AppIcon as well. Part-of: --- diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index 393e49e98..c7959f352 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -2934,9 +2934,11 @@ export const AppIcon = GObject.registerClass({ }, }, class AppIcon extends AppViewItem { _init(app, iconParams = {}) { - // Get the isDraggable property without passing it on to the BaseIcon: + // Get properties without passing them on to the BaseIcon: const isDraggable = iconParams['isDraggable'] ?? true; delete iconParams['isDraggable']; + const popupMenuSide = iconParams['popupMenuSide'] ?? St.Side.LEFT; + delete iconParams['popupMenuSide']; const expandTitleOnHover = iconParams['expandTitleOnHover']; delete iconParams['expandTitleOnHover']; @@ -2945,6 +2947,7 @@ export const AppIcon = GObject.registerClass({ this.app = app; this._id = app.get_id(); this._name = app.get_name(); + this._popupMenuSide = popupMenuSide; this._iconContainer = new St.Widget({ layout_manager: new Clutter.BinLayout(), @@ -3078,13 +3081,13 @@ export const AppIcon = GObject.registerClass({ return this.app.get_id(); } - popupMenu(side = St.Side.LEFT) { + popupMenu() { this.setForcedHighlight(true); this._removeMenuTimeout(); this.fake_release(); if (!this._menu) { - this._menu = new AppMenu(this, side, { + this._menu = new AppMenu(this, this._popupMenuSide, { favoritesSection: true, showSingleWindows: true, }); diff --git a/js/ui/dash.js b/js/ui/dash.js index 585f34063..f9b55c040 100644 --- a/js/ui/dash.js +++ b/js/ui/dash.js @@ -24,13 +24,10 @@ class DashIcon extends AppDisplay.AppIcon { super._init(app, { setSizeManually: true, showLabel: false, + popupMenuSide: St.Side.BOTTOM, }); } - popupMenu() { - super.popupMenu(St.Side.BOTTOM); - } - // Disable scale-n-fade methods used during DND by parent scaleAndFade() { }